const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  devServer: {
    open: true,
    host: '192.168.1.28',  // 域名
    port: '9528',  // 端口
    proxy: {
      '/api': {
        target: 'https://www.hongmai.vip',
        // https请求需要该设置
        secure: false,
        // 必须设置该项
        changeOrigin: true,
        pathRewrite: {
          "^/api": "" //这里理解成用 “/api”代替target里面的地址，后面组件中我们调接口是直接用api代替
          //比如我要调用 ‘http：、、40.00.100.100:1001:3000/user/info’  直接写成 ‘/api/user/info’}
        },
        headers: {
          // Referer: 'http://192.168.1.17:9527'
          // Referer: 'http://47.122.2.148:9527'
          Referer: 'https://www.hongmai.vip'
          // Referer: 'http://127.0.0.1:9527'
        }
      },
    }
  }
})
